﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace Sakura.Silverlight.Extensions
{
	/// <summary>
	/// 为集合项目的交替效果提供辅助支持。
	/// </summary>
	public class Alternation
	{

		public static int GetCount(ItemsControl obj)
		{
			return (int)obj.GetValue(CountProperty);
		}

		public static void SetCount(ItemsControl obj, int value)
		{
			obj.SetValue(CountProperty, value);
		}

		// Using a DependencyProperty as the backing store for Count.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty CountProperty =
			DependencyProperty.RegisterAttached("Count", typeof(int), typeof(Alternation), new PropertyMetadata(0));



		public static int GetIndex(DependencyObject obj)
		{
			return (int)obj.GetValue(IndexProperty);
		}

		public static void SetIndex(DependencyObject obj, int value)
		{
			obj.SetValue(IndexProperty, value);
		}

		// Using a DependencyProperty as the backing store for Index.  This enables animation, styling, binding, etc...
		public static readonly DependencyProperty IndexProperty =
			DependencyProperty.RegisterAttached("Index", typeof(int), typeof(Alternation), new PropertyMetadata(0));

		
	}
}
